﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using System.Text;
using SD.Database;

namespace smallDeimos.Game
{
    public partial class SystemView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int sId;
            if (int.TryParse(Request.QueryString["sId"], out sId) == true)
                Label1.Text = Systems.SystemName(sId).ToString();

        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int pId = 0;
            GridViewRow row = GridView1.SelectedRow;
            try
            {
                pId = UserFunctions.GetPlayerID(row.Cells[2].Text);
                Response.Redirect("PlayerInfo.aspx?pId=" + pId.ToString());
            }
            catch (Exception ex)
            {
                StringBuilder sb = new StringBuilder("_");
                foreach (TableCell c in row.Cells)
                    sb.Append(c.Text + "_");
                throw new Exception(sb.ToString(), ex);
            }
        }
    }
}
